import { ComponentOptions } from 'vue'
const share = {
  title: '捏捏球',
  path: '/pages/index/index',
  imageUrl: '分享显示的图片链接',
  desc: '捏捏球，心理疏导'
} as any
// 分享到微信好友功能
const onShareAppMessage = (res: any) => {
  return {
    title: share.title,
    path: share.path,
    desc: share.desc,
    imageUrl: share.imageUrl,
    success(res) {
      uni.showToast({
        title: '分享成功'
      })
    },
    fail(res) {
      uni.showToast({
        title: '分享失败',
        icon: 'none'
      })
    }
  }
}
// 分享到朋友圈功能
const onShareTimeline = (res: any) => {
  return {
    title: share.title,
    path: share.path,
    desc: share.desc,
    imageUrl: share.imageUrl,
    success(res) {
      uni.showToast({
        title: '分享成功'
      })
    },
    fail(res) {
      uni.showToast({
        title: '分享失败',
        icon: 'none'
      })
    }
  }
}
// const a: ComponentOptions = {}
// a.onShareAppMessage = onShareAppMessage
// a.onShareTimeline
export default {
  onShareTimeline,
  onShareAppMessage
} as any
